<template>
  <ChatbotButton @toggle-chat="handleToggleChat" />
  <ChatbotWindow :isVisible="isChatOpen" :position="buttonPosition" />
</template>

<script>
import ChatbotButton from "./components/ChatbotButton.vue";
import ChatbotWindow from "./components/ChatbotWindow.vue";

export default {
  components: { ChatbotButton, ChatbotWindow },
  data() {
    return {
      isChatOpen: false,
      buttonPosition: { top: 0, left: 0 },
    };
  },
  methods: {
    handleToggleChat({ isOpen, position }) {
      this.isChatOpen = isOpen;
      this.buttonPosition = position;
    },
  },
};
</script>
